<?php 
defined('IN_TS') or die('Access Denied.');

class study extends tsApp{
	
	//构造函数
	public function __construct($db){
		parent::__construct($db);
	}
	
	//获取一个课程
	function getOneStudy($studyid){
		$strStudy=$this->find('study',array(
			'studyid'=>$studyid,
		));
		
		$strStudy['studyname'] = tsTitle($strStudy['studyname']);
		$strStudy['studydesc'] = tsDecode($strStudy['studydesc']);
		
		if($strStudy['photo'] == ''){
			$strStudy['photo'] = SITE_URL.'app/study/skins/default/kecheng.gif';
		}else{
			$strStudy['photo'] = tsXimg($strStudy['photo'],'study',255,140,$strStudy['path'],1);
		}
		return $strStudy;
	}
	
	//析构函数
	public function __destruct(){
		
	}
	
}